Creates a preview for the selected file.